home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 57131 / 57131.xpi / chrome / beefree.jar / content / beefree / h / bf.h.script.js
Encoding:
JavaScript  |  2010-01-25  |  1.9 KB  |  48 lines

  1. /*
  2.     2010 - Copyright by Bee <http://www.honeybeenet.altervista.org>.
  3.     This program is free software; you can redistribute it and/or
  4.     modify it under the terms of the GNU General Public License
  5.     as published by the Free Software Foundation; either version 2
  6.     of the License, or (at your option) any later version.
  7.  
  8.     This program is distributed in the hope that it will be useful,
  9.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.     GNU General Public License for more details.
  12.  
  13.     You should have received a copy of the GNU General Public License
  14.     along with this program; if not, write to the Free Software
  15.     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. */
  17.  
  18. //Filter handler for internal scripts!!!!!!!!!!
  19. function beefree_h_script_add(data)
  20. {
  21.     data = beefree_h_script_overwrite_bool_check(data, "enabled");
  22.     data = beefree_h_script_overwrite_bool_check(data, "referer.remove");
  23.     data = beefree_h_script_overwrite_bool_check(data, "useragent.remove");
  24.     data = beefree_h_script_overwrite_bool_check(data, "links.remove");
  25.     data = beefree_h_script_overwrite_bool_check(data, "links.onload");//extra
  26.     beefree_website_add(data);
  27.     //beefree_console_print("[BeeFREE] has added this filter `" + data["name"] + "'!!!!");
  28. }
  29.  
  30. function beefree_h_script_overwrite_bool_check(data, item)
  31. {
  32.     var path = "website." + data["name"] + "." + item;
  33.     //beefree_console_print("[BeeFREE] Test on: " + path);
  34.     if(beefree_pref_do_exists(path))
  35.     {
  36.         var value = beefree_pref_do_get_bool(path, data[item]);
  37.         if(value == data[item])
  38.         {
  39.             beefree_console_print("[BeeFREE] Removing default value `"+value+"' set on: " + path.toLowerCase() + " (relative path)");
  40.             beefree_pref_do_delete(path);
  41.         }
  42.         else
  43.             data[item] = value;
  44.     }
  45.     return data;
  46. }
  47.  
  48.